package com.coska;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * 测试向多张表插入数据
 */
public class Main1 {


    public static void main(String[] args) {
        long begin = System.currentTimeMillis();

        ExecutorService executorService = Executors.newCachedThreadPool();
        for (int i = 0; i < 10; i++) {//设置线程数
            executorService.submit(new ProcedureTest());
        }
        executorService.shutdown();
        while (true){
            if (executorService.isTerminated()){//所有线程执行完毕，输出执行总时间
                long end = System.currentTimeMillis();
                System.out.println((end - begin)/1000.0 + "s");
                break;
            }

        }
    }
}
